package com.sky.mapper;

import com.sky.entity.Dish;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 菜品 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-06-25
 */
@Mapper
public interface DishMapper extends BaseMapper<Dish> {

    @Select("select * from dish where category_id = #{categoryId}")
    List<Dish> getDishByCategoryId(Long categoryId);
    @Select("select * from dish where name = #{name}")
    Dish selectByName(String name);
    @Select("select count(*) from dish where id = #{id}")
    Integer countByCategoryId(Long id);
}
